import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

//异步路由
const list = (resolve) => {
  import('../views/list').then((module) => {
    resolve(module)
  })
}

const edit = (resolve) => {
  import('../views/edit').then((module) => {
    resolve(module)
  })
}

const detail = (resolve) => {
  import('../views/detail').then((module) => {
    resolve(module)
  })
}

export default new Router({
  routes: [
    {
      path: '/',
      component: list
    },
    {
      path: '/list',
      component: list
    },
    {
      path: '/edit',
      component: edit
    },
    {
      path: '/detail',
      component: detail
    }

  ]
})